package x.core.modelconvertplug;

import java.lang.reflect.Array;

import x.core.ModelConvert;
public class ArrayModelConvert extends ModelConvert implements IModelConvert{
	@SuppressWarnings("rawtypes")
	public Object convertObjectValue(Object objectValues) {
		String[] stringValues = (String[]) objectValues;
		Class classz = this.getConvertField().getType().getComponentType();
		ModelConvert convert = ModelConvert.instance(classz);
		Object arry = Array.newInstance(classz,stringValues.length);
		for(int i = 0; i < stringValues.length;i++){
			Array.set(arry, i, convert.convertObjectValue(stringValues[i]));
		}
		return arry;
	}
	
}
